package io.lkt.modules.sys.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.lkt.modules.sys.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 用户信息表
 * 
 * @author xss
 * @email dustwas@163.com
 * @date 2019-03-09 09:46:37
 */
@Mapper
public interface BUserInfoDao extends BaseMapper<BUserInfoEntity> {

	BUserVipValidEntity getVipValid(Integer userId);

	String vipTime(Integer userId);

	Integer addVipLog(Map<String, Object> map);

	Integer vipValidTotal(Integer userId);

	Integer addVipValid(Map<String, Object> map);

	Integer setVipValid(Map<String, Object> map);

	Map<String, Object> mainTotal();

	List<BUserInfoEntity> queryList(Map<String, Object> map);

	String getBrandNameByUserId(Integer userId);

	List<BUserInfoEntity> referer(Map<String, Object> map);

	Integer refererTotal(Map<String, Object> map);

	Integer fufei(@Param("referer") Integer referer);

	Integer userTotal(Map<String, Object> map);

	Integer queryUserVitelTotal(Map<String, Object> map);

	List<BUserVitalEntity> queryUserVital(Map<String, Object> map);

	List<BUserInfoEntity> secondReferer(Map<String, Object> map);

	Integer secondTotal(Map<String, Object> map);

	Integer secondFufei(Map<String, Object> map);

	Integer secondRefererTotal(Map<String, Object> map);

	int deleteVirtualVisitUsers(List<String> virtualUserIds, Integer userId);

	List<BrandUserEntity> brandUser(Map<String, Object> map);

	int brandUserTotal(Map<String, Object> map);

	int brandPayUserTotal(Map<String, Object> map);

	List<BrandUserEntity> brandPayUser(Map<String, Object> map);

	BrandUserEntity brandUserHead(Map<String, Object> map);

	int closeVip(Integer userId);

	List<BUserVitalEntity> queryUserVitalByGzh(Map<String, Object> map);

	//获取今天关注该公众号的数量(触发关注数)
	Integer getSubscribeCountByAppId(@Param("appId") String appId);

	//获取今天取关该公众号的数量(触发取关数)
	Integer getUnSubscribeCountByAppId(@Param("appId") String appId);

	//获取今天取关该公众号的用户数
	Integer getSubUserCountByAppId(@Param("gzhCode") String gzhCode);

	//获取今天取关该公众号的用户数
	Integer getUnSubUserCountByAppId(@Param("gzhCode") String gzhCode);

	//获取指定日期的关注该公众号的数量(触发关注数)
	Integer getSubscribeCountByDate(@Param("appId") String gzhCode, @Param("startDate") String startDate, @Param("endDate") String endDate);

	//获取指定日期的取关该公众号的数量(触发取关数)
	Integer getUnSubscribeCountByDate(@Param("appId") String gzhCode, @Param("startDate") String startDate, @Param("endDate") String endDate);

	List<BUserInfoEntity> queryToDaySubUsers(String gzhCode);

	int blockByUser(@Param("userId") Integer userId);

	int cancelBlockByUser(@Param("userId") Integer userId);

	int handle(@Param("id") Integer id);

	List<BtipOffInfoEntity> queryComplainList(Map<String, Object> paramMap);

	Integer queryComplainTotal(Map<String, Object> paramMap);

	int updateCensus();

	List<BUserInfoEntity> queryUserByGzhCode(@Param("gzhCode") String gzhCode);

	BUserInfoEntity getSelfUser(@Param("userId") Integer userId);

	List<BUserInfoEntity> getSubUser(@Param("userId") Integer userId);

	List<BUserInfoEntity> getNotFingerUser();

	List<BUserInfoEntity> getkdbjzzsq();

    List<BUserPunchClockInfoEntity> getUserClockInfo(Map<String, Object> params);

	Integer getClockInfoTotal(Map<String, Object> params);

	int getSubUserCount(@Param("userId") Integer userId);

	Integer queryTodayComplainTotal(Map<String, Object> map);

	BtipOffInfoEntity getLatestComplain(Map<String, Object> map);

	BUserGroupOpenidEntity getMainUserId(@Param("userId") Integer userId);

	List<BUserInfoEntity> getUserOtherFollowGzh(Map<String, Object> map);

	Integer getUserOtherFollowGzhTotal(Map<String, Object> map);

	String getUnionId(@Param("userId") Integer userId);

    List<BUserInfoEntity> getReferrerInfo(Map<String, Object> map);

	Integer getReferrerInfoTotal(Map<String, Object> map);

    String getUserName(Integer userId);

    List<BUserInfoEntity> getUnsubscribeUser(Map<String, Object> map);

	Integer getUnsubscribeUserTotal(Map<String, Object> map);

    List<BUserInfoEntity> getNoWorthUser(Map<String, Object> map);

	Integer getNoWorthUserTotal(Map<String, Object> map);

	BUserInfoEntity queryUserInfo(Integer userId);
}
